<script>
	import {
		mapGetters,
		mapActions
	} from "vuex"
	
	export default {
		computed: {
			...mapGetters(['userInfo'])
		},
		onLaunch: function() {
			
		},
		onShow: function() {
			this.getConfig()
			this.getMine()
		},
		onHide: function() {
			
		},
		methods: {
			...mapActions(['setConfig', 'setUser']),
			getConfig() {
				let keys = ['card_img', 'service_mobile', 'service_img', 'red_use_amount', 'people_number_switch',
					'service_slogan', 'applet_name', 'applet_copyright','promoter_switch', 'promotion_model',
					'card_title', 'play_rules', 'purchase_agreement', 'active_recycling',
					'recycle_present_switch', 'card_title', 'card_img', 'service_mobile','box_share']
				this.$net.req('/config/getBatchByKeys', {keys}, false).then(res => {
					if (res.code == 200) {
						this.setConfig(res.data)
					}
				})
			},
			getMine() {
				this.$net.req('/user/getMine', {}, false).then(res => {
					if (res.code === 200) {
						this.setUser(res.data)
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	.page,
	.uni-body {
		// background-color: #F5F7FA;
		background-color: #292C2D;
	}
	page{
		background-color: #292C2D;
		// 全局页面颜色
	}
	
	// reset uview style
	.custom-popup.no-background .u-mode-center-box {
		background-color: transparent;
	}
	
	.custom-tabs .u-tab-item {
		padding: 0 !important;
	}
	
	// 隐藏滚动条
	scroll-view ::-webkit-scrollbar {
		display: none
	}
	
	// uview组件样式
	@import "uview-ui/index.scss";
	
	// 全局公共样式
	@import "styles/common.scss";
	
	// 隐藏顶部导航
	/* #ifdef H5 */ uni-page-head { display: none; } /* #endif */

	.authorization {
		background-color: $uni-bg-color;
		font-size: 32rpx;
		height: 100%;
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #2F2E3B;
	
		&::after {
			border: 0;
		}
	}

</style>
